<template>
  <div>
    <PublicTable
      ref="table1"
      :loading="false"
      :table-data="tabledata"
      :columns="columns"
      :options="options"
      @row-click="bzrowClick"
    />
    <el-dialog
      :title="iframeTitle"
      :visible.sync="diosho"
      :width="'80%'"
      :close-on-click-modal="false"
      :close-on-press-escape="false"
      :modal-append-to-body="false"
      append-to-body
    >
      <div class="aaaa" :style="`height: 500px; overflow-y: auto`">
        <iframe
          :src="iframeSrc"
          height="95%"
          width="100%"
          frameborder="0"
          style="overflow: hidden;"
        ></iframe>
      </div>
    </el-dialog>
  </div>
</template>

<script>
const columns = [
  {
    label: "作业线",
    prop: "STDTYPE",
    minwidth: "60",
  },
  {
    label: "年度累计",
    prop: "SUMVAL",
    minwidth: "100",
  },
  {
    label: "指标项",
    prop: "STDITEM",
    minwidth: "70",
  },
  {
    label: "平均值",
    prop: "AVGVAL",
    minwidth: "100",
  },
  {
    label: "指标值",
    prop: "STDVAL",
    minwidth: "100",
  },
  {
    label: "达标情况",
    minwidth: "100",
    formatter(row, index) {
      return `<div style="color:#E53846;font-size:13px">${row.MEMO}</div>`;
    },
  },
];
// 标准作业线
export default {
  name: "Bzzyx",
  props: {
    options: {
      type: Object,
      default() {
        return {}
      }
    }
  },
  data() {
    return {
      columns,
      diosho: false,
      iframeTitle: "",
      iframeSrc: "",
      tabledata: [],
    }
  },
  mounted() {
    this.initData();
  },
  methods: {
    bzrowClick(row, column, event) {
      if (!row.LIANJIE) return false
      this.diosho = true
      this.iframeTitle = row.TITLE
      this.iframeSrc = row.LIANJIE
    },
    initData() {
      this.$api.summary.get_bzzyx().then((val) => {
        this.tabledata = val;
      });
    },
  }
}
</script>

<style lang="scss">

</style>
